package com.sinven.entity;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * NideshopTopicId entity. @author MyEclipse Persistence Tools
 */
/**
 * 李志伟
 * 反向生成
 */
@Embeddable
public class TopicId implements java.io.Serializable {

    // Fields

    private Integer id;
    private String title;
    private String content;
    private String avatar;
    private String subtitle;
    private Integer topicCategoryId;
    private String readCount;
    private String scenePicUrl;

    // Constructors

    /** default constructor */
    public TopicId() {
    }

    /** minimal constructor */
    public TopicId(Integer id, String title, String avatar,
                           String subtitle, Integer topicCategoryId,
                           String readCount, String scenePicUrl) {
        this.id = id;
        this.title = title;
        this.avatar = avatar;
        this.subtitle = subtitle;
        this.topicCategoryId = topicCategoryId;
        this.readCount = readCount;
        this.scenePicUrl = scenePicUrl;
    }

    /** full constructor */
    public TopicId(Integer id, String title, String content,
                           String avatar, String subtitle, Integer topicCategoryId,
                           String readCount, String scenePicUrl) {
        this.id = id;
        this.title = title;
        this.content = content;
        this.avatar = avatar;
        this.subtitle = subtitle;
        this.topicCategoryId = topicCategoryId;
        this.readCount = readCount;
        this.scenePicUrl = scenePicUrl;
    }

    // Property accessors

    @Column(name = "id", nullable = false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Column(name = "title", nullable = false)
    public String getTitle() {
        return this.title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Column(name = "content", length = 65535)
    public String getContent() {
        return this.content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Column(name = "avatar", nullable = false)
    public String getAvatar() {
        return this.avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    @Column(name = "subtitle", nullable = false)
    public String getSubtitle() {
        return this.subtitle;
    }

    public void setSubtitle(String subtitle) {
        this.subtitle = subtitle;
    }

    @Column(name = "topic_category_id", nullable = false)
    public Integer getTopicCategoryId() {
        return this.topicCategoryId;
    }

    public void setTopicCategoryId(Integer topicCategoryId) {
        this.topicCategoryId = topicCategoryId;
    }

    @Column(name = "read_count", nullable = false)
    public String getReadCount() {
        return this.readCount;
    }

    public void setReadCount(String readCount) {
        this.readCount = readCount;
    }

    @Column(name = "scene_pic_url", nullable = false)
    public String getScenePicUrl() {
        return this.scenePicUrl;
    }

    public void setScenePicUrl(String scenePicUrl) {
        this.scenePicUrl = scenePicUrl;
    }

    public boolean equals(Object other) {
        if ((this == other))
            return true;
        if ((other == null))
            return false;
        if (!(other instanceof TopicId))
            return false;
        TopicId castOther = (TopicId) other;

        return ((this.getId() == castOther.getId()) || (this.getId() != null
                && castOther.getId() != null && this.getId().equals(
                castOther.getId())))
                && ((this.getTitle() == castOther.getTitle()) || (this
                .getTitle() != null && castOther.getTitle() != null && this
                .getTitle().equals(castOther.getTitle())))
                && ((this.getContent() == castOther.getContent()) || (this
                .getContent() != null && castOther.getContent() != null && this
                .getContent().equals(castOther.getContent())))
                && ((this.getAvatar() == castOther.getAvatar()) || (this
                .getAvatar() != null && castOther.getAvatar() != null && this
                .getAvatar().equals(castOther.getAvatar())))
                && ((this.getSubtitle() == castOther.getSubtitle()) || (this
                .getSubtitle() != null
                && castOther.getSubtitle() != null && this
                .getSubtitle().equals(castOther.getSubtitle())))
                && ((this.getTopicCategoryId() == castOther
                .getTopicCategoryId()) || (this.getTopicCategoryId() != null
                && castOther.getTopicCategoryId() != null && this
                .getTopicCategoryId().equals(
                        castOther.getTopicCategoryId())))
                && ((this.getReadCount() == castOther.getReadCount()) || (this
                .getReadCount() != null
                && castOther.getReadCount() != null && this
                .getReadCount().equals(castOther.getReadCount())))
                && ((this.getScenePicUrl() == castOther.getScenePicUrl()) || (this
                .getScenePicUrl() != null
                && castOther.getScenePicUrl() != null && this
                .getScenePicUrl().equals(castOther.getScenePicUrl())));
    }

    public int hashCode() {
        int result = 17;

        result = 37 * result + (getId() == null ? 0 : this.getId().hashCode());
        result = 37 * result
                + (getTitle() == null ? 0 : this.getTitle().hashCode());
        result = 37 * result
                + (getContent() == null ? 0 : this.getContent().hashCode());
        result = 37 * result
                + (getAvatar() == null ? 0 : this.getAvatar().hashCode());
        result = 37 * result
                + (getSubtitle() == null ? 0 : this.getSubtitle().hashCode());
        result = 37
                * result
                + (getTopicCategoryId() == null ? 0 : this.getTopicCategoryId()
                .hashCode());
        result = 37 * result
                + (getReadCount() == null ? 0 : this.getReadCount().hashCode());
        result = 37
                * result
                + (getScenePicUrl() == null ? 0 : this.getScenePicUrl()
                .hashCode());
        return result;
    }

}